﻿using System.IO.Pipes;

namespace IoTSignalR.Child
{
    internal class Program
    {
        static async Task Main(string[] args)
        {
            try
            {
                var splitValue = args[0].Split('$');
                Console.WriteLine(splitValue[0] + "$" + splitValue[1]);
                var anonymousPipeClient = new AnonymousPipeClient(splitValue[0], splitValue[1]);
                anonymousPipeClient.ReceiveMessageEvent += (sender, msg) =>
                {
                    Console.WriteLine("子进程匿名管道接收消息:" + msg);
                };
                await anonymousPipeClient.StartAsync();
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                Console.WriteLine("子进程匿名管道接收消息:" + ex.Message);
            }
        }
    }
}
